Skip to content

feat(embeddings): add Perplexity embeddings provider - #10142

Draft
andrewmadson-pplx wants to merge 1 commit into
simstudioai:stagingfrom
andrewmadson-pplx:pplx/embeddings-provider
Draft

andrewmadson-pplx wants to merge 1 commit into
simstudioai:stagingfrom
andrewmadson-pplx:pplx/embeddings-provider

Conversation

@andrewmadson-pplx

Copy link
Copy Markdown

Summary

Adds Perplexity as an Embeddings block provider, backed by the Perplexity Embeddings API (POST https://api.perplexity.ai/v1/embeddings) with pplx-embed-v1-0.6b (up to 1024 dimensions) and pplx-embed-v1-4b (up to 2560). It follows the Mistral provider: adapter, catalog entries, key resolution (BYOK, PERPLEXITY_API_KEY), the embeddings_perplexity tool, block routing, the internal tool registry, pricing, generated metadata and docs.

The API returns vectors as base64_int8 and has no float encoding (encoding_format: "float" returns 400), so the adapter decodes the signed int8 values and L2-normalizes them. Cosine similarity is unchanged and the block returns unit vectors like the other providers. Knowledge-base indexing stays off (kbEligible: false), the same as Mistral and Cohere.

I work at Perplexity, which operates this API.

Product update (if relevant)

Embeddings block users can pick Perplexity and choose pplx-embed-v1-4b or pplx-embed-v1-0.6b, with Matryoshka dimension reduction down to 128. Docs: integrations/embeddings.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • cd apps/sim && bun run test -- lib/embeddings tools/embeddings blocks/blocks/embeddings.test.ts lib/internal/embeddings lib/internal/tool-operations (with the CI env vars NEXT_PUBLIC_APP_URL, DATABASE_URL, ENCRYPTION_KEY): Test Files 19 passed (19), Tests 134 passed (134). The new adapter tests cover the request body (base64_int8, reduced dimensions), the request headers, and int8 decoding to unit vectors in input order. The tool projection test now includes the new tool.
  • bun run --cwd apps/sim type-check and bun run type-check:scripts:esm: exit 0, no diagnostics.
  • bun run lint:check: 27 of 27 tasks pass (one existing warning in a file this PR does not touch).
  • bun run check:tool-metadata, check:docs, check:integration-catalog, check:deployment-config, check:mapper-operation, check:canvas-sentences and check:explicit-any, plus apps/sim/scripts/check-block-registry.ts: all exit 0.
  • Live calls through the adapter's buildRequest and parse: both models at native width (1024 and 2560), and pplx-embed-v1-4b at 1024 and 128, each returned one unit vector per input at the requested width, with related inputs scoring higher than unrelated ones.

To try it: run bun run dev, add an Embeddings block, set Provider to Perplexity and enter a Perplexity API key. With pplx-embed-v1-4b and default dimensions, embed two or three strings and check you get one 2560-length vector per input, in input order. Set Dimensions to 1024 and check the vectors are 1024 long. Pick pplx-embed-v1-0.6b and check the Dimensions dropdown tops out at 1024.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

@andrewmadson-pplx is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant